<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人店铺首页</title>
<link href="<?php echo $this->_webroot('/style/jq-ui/jquery-ui-1.8.18.custom.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/css.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/content.css'); ?>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo $this->_webroot('script/jquery-1.7.1.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/jquery-ui-1.8.18.custom.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/jquery.carouFredSel-5.5.0-packed.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/js.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/content.js'); ?>"></script>
</head>

<body>
<psp:tags     htmlname='shop_topnav'  iconname='shoptopnav' />


<div class="head headpadding">
    <psp:tags     htmlname='shopsearch_default'  iconname='shopsearch_default' />
    <div class="clear"></div>
</div>
<!-- nav_wrap -->
<div class="nav_wrap">
	<div class="nav_logo border_bottom1">
    	<img src="<?php if(!empty($SHOP['shop_template_img'])) {echo $SHOP['shop_template_img'];}else{echo $this->_webroot('photo/company_logo.jpg');}?>"  onerror="this.src='<?php echo $this->_webroot('photo/company_logo.jpg'); ?>'" width="998" height="154" />
    	<div class="nav1_content">
    		<ul class="nav1_ul">
                <psp:tags     htmlname='shopnav_default'  iconname='shopnav' />
            </ul>	
        
    	</div>    
    </div>
    
</div>
<!-- nav_wrap end -->

<div class="container margintop1">

	<!-- main_left -->
	<div id="main_left">
	
		<psp:tags     htmlname='shopleftmenu_default'  iconname='shopleftmenu_default' />		
        <!--  客服中心 -->
		<psp:tags     htmlname='shopservice_default'  iconname='shopservice_default' />
        <!--  客服中心 end -->
        
        <!-- 销量排行 -->
        <div class="ranked_sales_wrap margintop1 float1">
        	<div class="ranked_sales_hd">
               <div class="left1">推荐商家</div><div class="right1"><!--<a href="#">+更多</a>--></div>           
            </div>
            <ul class="rank_list_content display1">
			    <?php foreach($shoplinks as $value) { $value=$value['shoplinks']; ?>
            	<li>
                	<a href="" class="prot_img_a"><img src="<?php echo $value['pic'];?>"  onerror="this.src='<?php echo $this->_webroot('photo/sale_prot_img1.gif'); ?>'" width="41" height="37" /></a>
                    <div class="rank_prot_content">
                    	<a href="<?php echo $value['url'];?>" target="<?php echo $value['target'];?>" class="rank_prot_title"><?php echo $value['name'];?></a>
                        <p class="rank_prot_p"><?php echo $value['content'];?></p>
                    </div>
                </li>
				<?php } ?>

                <div class="clear"></div>
            </ul> 
        </div>
        <!-- 销量排行 -->
        <div class="clear"></div>
        
        
    </div>
    <!-- main_left end -->

	<!-- main_right -->
	<div id="main_right">
    
    <div class="banner_self">
    	<div class="dianpu-slide-box">
        	<ul class="dianpu-slide">

          <?php  $i=0 ; if($promote_goods) {
          foreach($promote_goods as $value){  $i++; if($i>4)break;  ?>			
            	<li><a href="<?php echo $this->_url('shop/productshow/'.$value['goods']['id']);?>"><img src="<?php echo  $value['goods']['is_set_image'] ? $value['goods']['goods_thumb'] : 'skin/default/images/nopic.gif';?>" width="779" height="251" /></a></li>
          <?php }?>
          <?php }?>	               
            </ul>
        </div>
        <div class="dianpu-slide-tab-box">
        	<ul class="dianpu-slide-tab" id="dianpuslideShowTab">
          <?php $i=0 ; if($promote_goods) {
          foreach($promote_goods as $value){ $i++; if($i>4)break; ?>				
            	<li class="t<?php echo $i; ?> <?php if ($i==1) { ?> selected <?php } ?>"><div class="dianpu-slide-tab-bg-left"><div class="dianpu-slide-tab-bg-right"><?php echo  $value['goods']['goods_name'];?></div></div></li>
          <?php }?>
          <?php }?>	 				
            </ul>
        </div>
    </div>
    
    
    	<!-- 店铺推荐 -->
	<div class="shop_recommend_wrap margintop7">
    	<div class="shop_recommend_hd">
        	<span class="recommend_label">精品推荐</span>
            <a href="<?php echo $this->_url('shop/products/'.$SHOP['id']);?>" class="more1">+更多</a>
        </div>
        <div class="shoprecommend_wrap">
		
        	<ul class="pro_list_padding">
            <?php if($best_goods) {
            foreach($best_goods as $value){?>			
            	<li>
                	<div class="prot_img">
                      	<span class="newprot">新品上市</span>
                       	<a href="<?php echo $this->_url('shop/productshow/'.$value['goods']['id']);?>"><img src="<?php echo  $value['goods']['is_set_image'] ? str_replace('thumb_','',$value['goods']['goods_thumb']) : 'skin/default/images/nopic.gif';?>" alt="" width="160px" height="120px" /></a>
                    </div>
                    <div class="title"><a href="<?php echo $this->_url('shop/productshow/'.$value['goods']['id']);?>"><?php echo  $value['goods']['goods_name'];?></a></div>
                    <div class="attribute"><span>零售价：</span><span>￥<?php echo  $value['goods']['goods_refer_price'];?></span></div>
					<?php if (empty($shop_customer)) { ?>
                    <div class="attribute"><span>爱搜价：</span><span><?php if (isset($this->controller->my->id)) { ?>￥<?php echo  $value['goods']['goods_price'];?><?php }else{ ?>会员可见<?php } ?></span></div>
					<?php } else { ?>
                    <div class="attribute vip"><span><img src="<?php echo $this->_webroot('images/vip1.jpg'); ?>" />：</span><span class="vipPrice1">￥<?php echo  (($value['goods']['goods_price'] * $shop_customer['rebate'])/10) ;?></span></div>
					<?php } ?>
                    <div class="attribute"><span>库存：</span><span><?php echo  $value['goods']['goods_number'];?>件</span></div>
                    <div class="attribute attribute1">
                    	<span>数量：</span><a class="cutOrder" href="#"><img src="<?php echo $this->_webroot('images/cutNum.jpg'); ?>" /></a><input type="text" class="orderNum"  id="num<?php echo $v['id'] ;?>" name="num<?php echo $v['id'] ;?>"  value="1" /><a class="addOrder" href="#"><img src="<?php echo $this->_webroot('images/addNum.jpg'); ?>" /></a>
                    </div>
                    <input type="submit" class="orderBtn" value=""  onclick="javascript:addCart(<?php echo $v['id'] ;?>);" />
                </li>
            <?php }?>
            <?php }?>	
			
                <div class="clear"></div>  
             </ul>
            <input type="hidden" value="<?php echo  $this->controller->my->id;?>" id="shop_user" />
			<input type="hidden" value="<?php echo  $SHOP['id'];?>" id="shop_id" />				
<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js');?>"></script>
<script language="JavaScript">
	<!--
		function addCart(id) {
			var num = document.getElementById('num'+id);
			var shop_id = document.getElementById('shop_id').value;
			var user_id = document.getElementById('shop_user').value;
			
			var num_reg = /^(\d+)$/;
			if(!num_reg.test(num.value)){
				alert('购买数量格式不正确!');
				return;
			}
			if(num.value=='0'){
				alert('购买数量不能为0！');
				return;
			}

			if (shop_id == user_id){
				alert('自己的商品不能放入购物车');
			}else{
				ajax("<?php echo $this->_url('shop/goodsaddcart');?>","POST","id="+id+"&num="+num.value,function(data){
					if(data == 1) {
						alert("已成功添加到您的购物车！");
					} else if(data == -1) {
						alert("此商品已在您的购物车里！");
					} else if(data == -2) {
						alert("库存里没有这么多商品！");
					} else {
						alert("添加失败，请确认您是否已登陆！");
					}
				});
			}
		}
	-->	
</script>		 
             <div class="clear"></div>
             
        </div>
    </div>
<div class="clear"></div>	
	
<style>

.guestbook {
  /* border: 1px solid #CBCBCB;*/
	
}
.guestbook .ttl_guestbook {
    font-size: 14px;
    font-weight: bolder;
    line-height: 14px;
    margin-bottom: 20px;
    padding: 1px 0 9px 20px;
}
.guestbook li {
    line-height: 18px;
    margin-right: 8px;
    padding: 10px 20px;
    word-break: break-all;
    word-wrap: break-word;
}
.guestbook li.double {
    background-color: #F8F8F8;
}
.guestbook li .guester p {
    color: #666666;
}
.guestbook li .guester p.g_ttls {
    color: #333333;
    font-weight: bolder;
}
.guestbook li .shoper p.g_ttls {
    color: #FF0000;
    font-weight: bolder;
}
.guestbook li .guester p.g_txt {
    color: #333333;
    word-break: break-all;
    word-wrap: break-word;
}
.guestbook li span {
    color: #999999;
    margin-left: 10px;
}
.guestbook li .guester p.g_writer {
    float: right;
    width: 100px;
}
.guestbook li .guester p.g_txt {
    color: #333333;
    word-break: break-all;
    word-wrap: break-word;
}
.guestbook li .guester p.g_txt span {
    color: #999999;
    margin-left: 10px;
}
.guestbook li .guester p.g_writer {
    float: right;
    width: 100px;
}
.guestbook li .shoper p {
    color: #FF0000;
}
.guestbook li .guester a {
    color: #333333;
    font-weight: bolder;
}
.guestbook li .shoper a {
    color: #FF0000;
    font-weight: bolder;
}
.guestbook .guestInput input.btnSetmess {
    background: url("<?php echo $this->_webroot('user/images/btn_gusetwrite.gif'); ?>") no-repeat scroll left top transparent;
    border: medium none;
    cursor: pointer;
    display: block;
    height: 28px;
    margin: 15px 15px 0 0;
    text-indent: -9999px;
    width: 102px;
}
.guestbook .guestInput {
    margin-top: 12px;
}
.guestbook .guestInput input {
    color: #666666;
    padding: 5px;
    width: 480px;
}
.guestbook .guestInput textarea {
    padding: 5px;
    width: 480px;
}
.guestbook .guestInput .line {
    border-top: 1px dashed #FF0000;
    margin-right: 10px;
    padding-top: 20px;
}
.pagenav {
    margin: 20px;
    padding-bottom: 20px;
}
.pagenav a {
    border: 1px solid #DDDDDD;
    color: #AAAAAA;
    display: block;
    float: left;
    margin-right: 4px;
    padding: 4px 0;
    text-align: center;
    width: 23px;
}
.pagenav a.num {
    color: #AAAAAA;
    text-decoration: none;
}
.pagenav a:hover {
    color: #F77A07;
}
.pagenav .now {
    background-color: #EEEEEE;
    color: #AAAAAA;
}
.pagenav .now a:hover {
    color: #F77A07;
}
.pagenav .upPage, .pagenav .nextPage {
    color: #AAAAAA;
    text-decoration: none;
    width: 52px;
}
.pagenav span {
    color: #333333;
    display: table-cell;
    float: left;
    padding: 0 8px;
    vertical-align: bottom;
}
</style>	
	<div class="shop_recommend_wrap margintop7">
    	<div class="shop_recommend_hd">
        	<span class="recommend_label">买家留言</span>
           <!-- <a href="" class="more1">+更多</a> -->
        </div>	
      <div class="guestbook" id="message">
        <ul>
          <?php foreach($guestbook_list as $key =>$value){?>
          <li <?php if($key%2==0){?> class='double' <?php }?>>
            <div class="guester">

             <p><a><?php echo  $value['shopguest']['name'];?></a>:</p>
             <p class="g_txt"><?php echo  $value['shopguest']['content'];?>
             <span>[<?php echo  $value['shopguest']['add_time'];?>]</span></p>

            </div>
            <div class="shoper"> <?php if($value['shopguest']['reply']) {?>
             <p><a>店主回复:</a></p>
             <p class="g_txt"><?php echo  $value['shopguest']['reply'];?> </p>
              <?php }?> </div>
          </li>
          <?php }?>
        </ul>
		<div class="pagenav clearfix">
        	<?php if($this->params['paging']['shopguest']['count']>0){?>
        	        <a class="upPage"  href="<?php  echo Router::ArrayToUrl($this->params['paging']['shopguest']['pageurl'] + array('page'=> $this->params['paging']['shopguest']['page'] -1 )) ; ?>">上一页</a>
					<a  class="now"  href="#" ><?php  echo $this->params['paging']['shopguest']['page']; ?></a>
					<a class="nextPage" href="<?php  echo Router::ArrayToUrl($this->params['paging']['shopguest']['pageurl'] + array('page'=> $this->params['paging']['shopguest']['page'] +1 )) ; ?>" >下一页</a>
            <?php }?>
		</div>		
        <div class="guestInput">
          <form action="<?php echo $this->_url('guestbook/doguestbook');?>" name="guestForm" method="post" id="guestForm" onSubmit="return checkForm();">
            <input maxlength="20" name="name" type="hidden" value="<?php echo $this->controller->my->username;?>" />
            <input maxlength="50" name="email" type="hidden" value="<?php echo $this->controller->my->email;?>" />
            <input maxlength="50" name="contact" type="hidden" />
            <input type="hidden" name="shop_id" value="<?php echo  $SHOP['id'];?>" />
            <input type="hidden" name="shop_name" value="<?php echo  $SHOP['shop_name'];?>" />
            <p class="line"></p>
            <table id="sendbox" cellpadding="0" cellspacing="0" border="0" >
              <tr>
                <td align="right" valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;买家留言：</td>
                <td><textarea class="border_c" cols="80" rows="4"  name="content" id="textareac" onkeyup="this.value=this.value.slice(0,300);"></textarea></td>
              </tr>
              <tr>
                <td></td>
                <td><br/><input type="text" class="border_c" name="veriCode" id="veriCode" style="width:100px" maxlength="4" /> 
				<img  border="0" align="absmiddle"  src="<?php echo $this->_url('user/kcaptcha') .'?'. time(); ?>" id="cheimg" title="看不清，换一个" onClick="changImg('cheimg');" width="90" height='30'  />
          	    <a href="javascript:;" onclick="return changImg('cheimg');" style="color: #4E4E4E;">看不清,换一张</a></td>
              </tr>

              <tr>
                <td></td>
                <td><input class="btnSetmess" type="submit" value="我要留言" /></td>
              </tr>
            </table>
          </form>

        </div>
      </div>	
	 </div>
<script language="JavaScript">
<!--
function changImg(id){
document.getElementById(id).src ='<?php echo $this->_url('user/kcaptcha') .'?'; ?>'+Math.random(1);
}
//-->
</script>	
	
	
	
	
	
	
	
	<!-- 店铺推荐 end -->
    <div class="clear"></div>
    </div>
    <!-- main_right end -->

	<div class="clear"></div>
</div>

<!-- 友情链接 -->
<psp:tags     htmlname='links'  iconname='links' />
<!-- 友情链接 end -->

<div class="clear"></div>

<psp:tags     htmlname='default_footer'  iconname='defaultfooter' />

</body>
</html>